package com.stlm2.dems.entity.base;


import com.stlm2.dems.entity.GoodsCategoryLevel;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by ffl on 2017/10/12.
 */
public class BaseGoodsCategory implements Serializable {
    //
    private Integer id;
    //名称
    private String name;
    //图片路径
    private String imgUrl;
    //分类级别
    private GoodsCategoryLevel goodsCategoryLevel;
    //父分类ID
    private Integer parentCategoryId;

    //是否有效，有效（1），无效（0）
    private Boolean isValid;
    //创建时间
    private Date createTime;

    //优先级
    private Integer sort;
    //1 普通品牌   2 热门品牌
    private Integer categoryType;
    //创建者ID
    private Integer createUserId;

    //简介
    private String summary;

    //跳转链接
    private String linkUrl;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public GoodsCategoryLevel getGoodsCategoryLevel() {
        return goodsCategoryLevel;
    }

    public void setGoodsCategoryLevel(GoodsCategoryLevel goodsCategoryLevel) {
        this.goodsCategoryLevel = goodsCategoryLevel;
    }

    public Integer getParentCategoryId() {
        return parentCategoryId;
    }

    public void setParentCategoryId(Integer parentCategoryId) {
        this.parentCategoryId = parentCategoryId;
    }

    public Boolean getIsValid() {
        return isValid;
    }

    public void setIsValid(Boolean valid) {
        this.isValid = valid;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getCategoryType() {
        return categoryType;
    }

    public void setCategoryType(Integer categoryType) {
        this.categoryType = categoryType;
    }

    public Integer getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Integer createUserId) {
        this.createUserId = createUserId;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getLinkUrl() {
        return linkUrl;
    }

    public void setLinkUrl(String linkUrl) {
        this.linkUrl = linkUrl;
    }

    /**
     * 映射：分类等级
     */
    public Integer getGoodsCategoryLevelValue() {
        return (goodsCategoryLevel != null) ? goodsCategoryLevel.getIntValue() : null;
    }

    public void setGoodsCategoryLevelValue(Integer value) {
        if (value != null)
            this.goodsCategoryLevel = GoodsCategoryLevel.getByIntValue(value);
    }

}
